# encoding=utf-8
import yaml
from entity.postgre import postgres
from entity.redix import redix


class yml(object):

    def __init__(self):
        with open('../../resources/bootstrap.yml', 'r', encoding='utf-8') as f:
            ymls = yaml.load(f.read(), Loader=yaml.FullLoader)
            # print(ymls)
            self.redix = redix(ymls['redis']['host'], ymls['redis']['port'], ymls['redis']['db'], ymls['redis']['pass'])
            self.postgres = postgres(ymls['postgresql']['host'], ymls['postgresql']['port'], ymls['postgresql']['db'], ymls['postgresql']['user'], ymls['postgresql']['pass'])

# 6281291682467
# 15816014004
# print(yml())
# print(yml().redix.database)

# y = yml().ymls
# print(y)
# print(y['redis']["host"])
# os: Android
# osVersion: 10
# account:
#   username: xiaoqq
#   password: 123456
# deviceName: null
# appPackage: ~
# bool1: True

# with open('../../resources/bootstrap.yml', 'r', encoding='utf-8') as f:
#     result = yaml.load(f.read(), Loader=yaml.FullLoader)
# print(result, type(result))
# print(result['os'], type(result['os']))
# print(result['osVersion'], type(result['osVersion']))
# print(result['account'], type(result['account']))
# print(result['account']['username'])
# print(result['deviceName'])
# print(result['appPackage'])
# print(result['bool1'], type(result['bool1']))
